package cn.zzuisa.bluebox.biz.device.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 授权信息
 * </p>
 *
 * @author Ao
 * @since 2019-01-16
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("g_device_authority")
@ApiModel(value="Authority对象", description="授权信息")
public class Authority extends Model<Authority> {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "自增标识")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    private String name;

    @ApiModelProperty(value = "到期时间，为空则不限制")
    @TableField("expireTime")
    private LocalDateTime expireTime;


    @ApiModelProperty(value = "授权者")
    private Long authorizeer;

    @ApiModelProperty(value = "被授权者")
    private Long authorizeder;

    @ApiModelProperty(value = "设备的ID")
    @TableField("deviceId")
    private Long deviceId;

    @TableField("saveTime")
    private LocalDateTime saveTime;


    @ApiModelProperty(value = "是否限时：0为不限，1为限制")
    @TableField("isLimitExpire")
    private Integer isLimitExpire;
    private Integer authType;

    @Override
    protected Serializable pkVal() {
        return this.id;
    }

}
